1. Field of the Invention
The present invention relates to an image processing apparatus such as a print processing apparatus which processes a request for printing data of a text, an image, a path figure, or the like as well as to a related image processing program.
2. Description of the Related Art
In image-forming apparatus having a printing function such as printers, copiers, facsimile machines, and MFP (Multi-Function Peripheral) having the functions of these apparatus, a configuration for saving the memory area is known in which a print job of each page is converted into intermediate codes after being divided into plural bands, the intermediate codes are stored in memory areas, and image printing is performed on a page-by-page basis by rasterizing the stored intermediate codes into a bit image.
As for drawing of a gradation fill figure, a technique is proposed in which 1-line pixel information is copied to the pixels of the next line when gradation is detected. In this technique, Gradation is drawn by generating a gradient pattern by calculating pixel colors and copying it.
In such an image processing apparatus, in drawing processing of a gradient object, what number of gradation layers an image processing object has in the horizontal direction or the vertical direction is detected. Only the first gradation layer detected is calculated and the first layer is copied to the second and following layers. In this manner, the time taken to generate an object having a number of gradation layers which have a fixed pattern in the vertical direction or the horizontal direction is shortened. High-speed image processing is thus enabled.
Incidentally, consideration will be given to a case of generating a destination image DI1 shown in FIG. 7B which is H pixels in height and W pixels in width and is an expanded version of a source image (subject drawing object) SI1 shown in FIG. 7A which is 1 (H′) pixel in height and W′ pixels in width or a destination image DI2 shown in FIG. 8B which is H pixels in height and W pixels in width and is an expanded version of a source image SI2 (subject drawing object) shown in FIG. 8A which is H′ pixels in height and 1 (W′) pixel in width. In conventional image processing, when as shown in FIG. 9 source image data in a source image buffer is drawn on a destination buffer after subjecting it to computation, to generate a destination image through scan conversion it is necessary to refer to a source image pixel corresponding to each pixel of the destination image. However, in drawing an image by expanding 1-line source image data perpendicularly to the line direction, the same pixel of the source image is referred to many times in scan conversion, which is inefficient.
Where each page is divided into plural bands and drawing processing is performed on a band-by-band basis rather than on each page collectively, a 1-band memory area is used in drawing each band. In general memories, the processing speed may be high when data is written at continuous addresses and low when data is written at uncontinuous addresses. In setting memory areas for storage of bands, to enable high-speed processing, the band extending direction is made to coincide with the high-speed processible direction of the memory. Therefore, the processing speed is high when processing is performed in the band extending direction and is low when processing is performed in the direction perpendicular to it.
FIGS. 10A-10D show examples of expansion of a 1-line image. FIGS. 10A and 10B show a case that bands are generated so as to extend in the shorter direction of a page and FIGS. 10C and 10D show a case that bands are generated so as to extend in the longer direction of a page. FIGS. 11A and 11B show how images shown in FIGS. 10A and 10B are expanded so as to be replaced by rectangles. Images shown in FIGS. 10C and 10D are expanded in similar manners.
FIG. 11A shows a case that the image is expanded perpendicularly to the band extending direction, and FIG. 11B shows a case that the image is expanded in the band extending direction. Expanded images are shown in the second left parts of FIGS. 11A and 11B. Band-by-band expanded images are shown in the second right parts of FIGS. 11A and 11B. Since drawing processing is performed on a band-by-band basis, results of replacement of each same-color region with a rectangle are shown in the rightmost parts of FIGS. 11A and 11B (only one of plural replacement rectangles is shown). Where the longer sidelines of each rectangle are parallel with the band extending direction as in the case of FIG. 11B, processing perpendicular to the band extending direction occurs less frequently and hence the processing speed is high. In contrast, where the image is expanded perpendicularly to the band extending direction as in the case of FIG. 11A, the image is replaced by a large number of rectangles when the color of the image varies to a large extent. When the replaced rectangles are drawn, the processing speed is low because processing perpendicular to the band extending direction occurs frequently.
As described above, in gradation drawing processing based on a 1-line image, when an image with gradation having a high degree of color variation is expanded perpendicularly to the band extending direction, the image is expanded so as to be replaced by a large number of rectangles and hence the processing speed is low. Furthermore, since these rectangles are frequently processed in the direction perpendicular to the band extending direction, the memory access efficiency is low, which is also a factor of processing speed reduction by the replacement.